1. Field of the Invention
The present invention relates to data storage systems and data storage methods, and in particular relates to data storage of memories with copyback operations.
2. Description of the Related Art
Conventional data storage devices include hard discs and optical discs. Today, new data storage techniques have been developed. For example, solid state discs (SSD), a substitute for hard discs, use NAND flashes for data storage. The NAND flash is widely used in portable electronic devices. For example, in an mp3 audio player, the NAND flash is used as a popular storage medium.
A copyback operation, or named internal copy, is a common operation of NAND flashes. FIG. 1 depicts the structure of a NAND flash and shows how a copyback operation works on the NAND flash.
As shown, a NAND flash 100 has a plurality of blocks (numbered block0, block1 . . . blockn) and a buffer 102. The buffer 102 is designed for the copyback operation. The blocks block0 . . . blockn provide physical spaces for data storage. Each block can be divided into a plurality of pages. For example, in FIG. 1, the block block0 includes a plurality of pages page(0, 0), page(0, 1) . . . , the block block1 includes a plurality of pages page(1, 0), page(1, 1) . . . , and the blockn, includes a plurality of pages page(n, 0), page(n, 1) . . . . To write or read the NAND flash, a “Logic Address”, used in the host, has to be mapped to a “Physical Address” which addresses a physical space of the NAND flash 100. Each physical space may be a block, a page or even a smaller storage unit of the NAND flash 100.
Note that mapping between the logic address and the physical address is dynamic mapping. In some cases, data may be moved from one physical space to another physical space without changing its corresponding logical address. The copyback operation is one of the cases and may be utilized in various applications. For example, garbage collection, which frees physical spaces and makes the physical spaces clear for data storage, usually relies heavily on the copyback operation. Garbage collection may free physical spaces block by block. Referring to FIG. 1, to free the physical space of a block1, the valid data originally contained in the block1 has to be copied to another block such as blockn for backup before erasing block1 and marking block1 as a free physical space to write on. A data backup is provided by the copyback operation. As FIG. 1 shows, to use page(n, 1) of blockn to backup the valid data of page(1, 0) of block1, the copyback operation may first transmit the valid data from page(1, 0) to the buffer 102 and then transmit it from the buffer 102 to page(n, 1). Data transmission is an internal operation within the NAND flash 100 and a user is not aware of errors during the copyback operation.
In another case, the copyback operation is restricted within a page, wherein the data of one physical space (original space) of a page is copied to another physical space (destination space) of the same page. In such a case, data is first copied from the original space to a buffering space within the page and is then copied from the buffering space to the destination space. Similarly, data transmission is an internal operation within a NAND flash and a user is not aware of the errors during the copyback operation.
Because the user is not aware of the errors in the copyback operation, the data error may be accumulated during the following copyback operations and become un-repairable.